<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
</html>
<script>
    //深拷贝、浅拷贝面试经常会被问到的?项目当中常用
    //浅拷贝:`你变我也变`->指向同一个的地址
    let arr = [{id:1,tmName:'华为',logoUrl:'xxx'},{id:2,tmName:'vivo',logoUrl:'xxx'},{id:3,tmName:'oppo',logoUrl:'xxx'}]
    let tmForm = arr[1];
    //修改品牌的名字
    tmForm.tmName = '火箭';

    //深拷贝:'你变我不跟这变' JSON|递归
</script>
<script>
     //深拷贝:...拓展运算符，如果对象的V都是基本类型的数据，可以实现深拷贝
     //浅拷贝:...拓展运算符,如果对象V嵌套比较深有引用类型的数据,浅拷贝
     let obj = {a:1,b:2};
     let obj1 = {
          ...obj
     }
     obj1.a = 100;
     console.log(obj1);
     console.log(obj);
</script>